package com.powernode.feign;

import com.powernode.domain.Sku;
import com.powernode.feign.fallbackfactory.OrderProductFeignFallbackFactory;
import com.powernode.model.ChangeStock;
import com.powernode.model.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @create: 2024/7/25
 * @author: gyhe10
 * @description: 订单业务模块调用商品业务模块feign接口
 **/

@FeignClient(name = "product-service", fallbackFactory = OrderProductFeignFallbackFactory.class)
public interface OrderProductFeign {

    @GetMapping("prod/prod/getSkuListByIds")
    public Result<List<Sku>> getSkuListByIds(@RequestParam List<Long> skuIdList);

    @PostMapping("prod/prod/changeProdAndSkuStock")
    public Result<Boolean> changeProdAndSkuStock(@RequestBody ChangeStock changeStock);
}
